var config = require('./config.js');
App({
  onLaunch() {
    this.globalData.userInfo = wx.getStorageSync('userInfo');
    this.globalData.token = wx.getStorageSync('token');
    let dict = {
      'course_dynamic' : "课程动态",
      'course_with_me' : "我的课程"
    };
    wx.setStorageSync(
      'dict', dict
    )
  },

  //登录
  login() {
    if (this.globalData.userInfo == '' || this.globalData.userInfo == null || this.globalData.userInfo == undefined) {
      wx.navigateTo({
        url: '/pages/login/login',
      })
      return false
    }
    if (this.globalData.token == '' || this.globalData.token == null || this.globalData.token == undefined) {
      wx.navigateTo({
        url: '/pages/login/login',
      })
      return false
    }
    return true
  },

    
  globalData: {
    config: config
  }
})
